import { BaseDomain } from "@/common/domain/BaseDomain"
import { ApiProperty } from "@nestjs/swagger"
import { Transform } from "class-transformer"
import { IsNotEmpty, IsNumber, IsString, IsOptional } from "class-validator"
import { queryDomain } from "@/common/domain/queryDomain";
/**@description 查询费用表Dto */
export class QueryRentalPaymentDto extends queryDomain {
      @ApiProperty({description:"缴费类型", required:false})
      @IsOptional()
      paymentType: string | null
      @ApiProperty({description:"支付状态", required:false})
      @IsOptional()
      status: string | null
      @ApiProperty({description:"缴费金额", required:false})
      @IsOptional()
      @Transform((v) => +v.value)
      @IsNumber()
      amount: number | null
}
/**@description 创建费用表Dto */
export class CreateRentalPaymentDto {
      @ApiProperty({description:"租赁ID", required:true})
      @IsNotEmpty({ message: "租赁ID不能为空" })
      @Transform((v) => +v.value)
      @IsNumber()
      leaseId: number
      @ApiProperty({description:"缴费类型", required:true})
      @IsNotEmpty({ message: "缴费类型不能为空" })
      @IsString()    
      paymentType: string
      @ApiProperty({description:"支付状态", required:true})
      @IsNotEmpty({ message: "支付状态不能为空" })
      @IsString()    
      status: string
      @ApiProperty({description:"缴费日期", required:true})
      @IsNotEmpty({ message: "缴费日期不能为空" })
      @IsString()    
      paymentDate: string
      @ApiProperty({description:"缴费金额", required:true})
      @IsNotEmpty({ message: "缴费金额不能为空" })
      @Transform((v) => +v.value)
      @IsNumber()
      amount: number
      @ApiProperty({description:"创建时间", required:false})
      @IsOptional()
      @IsString()    
      createTime?: string
      @ApiProperty({description:"更新时间", required:false})
      @IsOptional()
      @IsString()    
      updateTime?: string
      @ApiProperty({description:"删除标记（0-已删除，1-正常）", required:false})
      @IsOptional()
      @IsString()    
      delFlag?: string
}
/**@description 更新费用表Dto */
export class UpdateRentalPaymentDto {
      @ApiProperty({description:"费用ID"})
      @IsNotEmpty({ message: "费用ID不能为空" })
      @Transform((v) => +v.value)
      @IsNumber()
      id: number
      @ApiProperty({description:"缴费类型", required:true})
      @IsNotEmpty({ message: "缴费类型不能为空" })
      @IsString()    
      paymentType: string
      @ApiProperty({description:"支付状态", required:true})
      @IsNotEmpty({ message: "支付状态不能为空" })
      @IsString()    
      status: string
      @ApiProperty({description:"缴费日期", required:true})
      @IsNotEmpty({ message: "缴费日期不能为空" })
      @IsString()    
      paymentDate: string
      @ApiProperty({description:"缴费金额", required:true})
      @IsNotEmpty({ message: "缴费金额不能为空" })
      @Transform((v) => +v.value)
      @IsNumber()
      amount: number
      @ApiProperty({description:"更新时间", required:false})
      @IsOptional()
      @IsString()    
      updateTime?: string
}